package cdu.javaendwork.service.Impl.AdoptionMore;

import cdu.javaendwork.dao.Universal;
import cdu.javaendwork.dao.impl.UniversalImpl;
import cdu.javaendwork.model.sqlModel.Reply;
import cdu.javaendwork.service.Interface.AdoptionMore.ReplyService;

import java.util.List;

public class ReplyServiceImpl implements ReplyService {

    Universal universal = new UniversalImpl();

    @Override
    public boolean insert(int userid, int remarkid, String content) {
        return universal.insert("Reply", userid, remarkid, content) == 1;
    }

    @Override
    public boolean delete(int id) {
        return universal.deleteById("Reply", id) == 1;
    }

    @Override
    public Reply findById(int id) {
        return universal.getById("Reply", id);
    }

    @Override
    public List<Reply> filterByRemarkIdLimit(int remarkid, int pageIndex, int pageSize) {
        return universal.filterLimit("Reply", "remarkid="+remarkid, pageIndex, pageSize);
    }
}
